 @include "bootbins.awk"
 function _bootbinsed() {
   srand(1001)
   print ""; bootbinsed1()
   print ""; bootbinsed2()
   print ""; bootbinsed3()
   }
 function bootbinsed1(   max,n,data,bins,b) {
   #srand(1)
   max=100;
   n=max; while(n--) data["p1"][n] = normal(13,1)
   n=max; while(n--) data["p2"][n] = normal(20,1)
   n=max; while(n--) data["p3"][n] = normal(20,1)
   n=max; while(n--) data["p4"][n] = normal(20,1)
   n=max; while(n--) data["p5"][n] = normal(20,1)
   n=max; while(n--) data["p6"][n] = normal(30,1)
   n=max; while(n--) data["p7"][n] = normal(40,1)
  # n=max; while(n--) data["p8"][n] = normal(40,1)
  # n=max; while(n--) data["p9"][n] = normal(40,1)
   
   bootbins(0,data,bins,0.3,95,250)
   for(b in bins)
     print bins[b]["key"], bins[b]["chop"],bins[b]["rank"] \
       | "sort -n -k 2"
   close("sort -n -k 2")
 }

 function bootbinsed2(   max,n,data,bins,b) {
   #srand(1)
   max=100;
   n=max; while(n--) data["p1"][n] = normal(20,1)
   n=max; while(n--) data["p2"][n] = normal(20,1)
   n=max; while(n--) data["p3"][n] = normal(20,1)
   n=max; while(n--) data["p4"][n] = normal(20,1)
   n=max; while(n--) data["p5"][n] = normal(20,1)
   n=max; while(n--) data["p6"][n] = normal(20,1)
   bootbins(0,data,bins,0.3,95,250)
   for(b in bins)
     print bins[b]["key"], bins[b]["chop"],bins[b]["rank"] \
       | "sort -n -k 2"
   close("sort -n -k 2")
 }

 function bootbinsed3(   max,n,data,bins,b) {
   #srand(1)
   max=100;
   n=max; while(n--) data["p1"][n] = normal(20,1)
   n=max; while(n--) data["p2"][n] = normal(20,1)
   n=max; while(n--) data["p3"][n] = normal(20,1)
   n=max; while(n--) data["p4"][n] = normal(30,1)
   n=max; while(n--) data["p5"][n] = normal(30,1)
   n=max; while(n--) data["p6"][n] = normal(30,1)
   bootbins(0,data,bins,0.3,95,250)
   for(b in bins)
     print bins[b]["key"], bins[b]["chop"],bins[b]["rank"] \
       | "sort -n -k 2"
   close("sort -n -k 2")
 }
